<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<style>
    .tablenes .tt{width: 15%!important;}
    .tablenes .tv{width: 35%!important;}
</style>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">

        <div><?php include "../public_flow/flow_show_info.php";?></div>

        <div class="table-box tablenes">
            <div class="title">出借人信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">出借人</td><td class="tv" id="chuer" colspan="3"></td></tr>
                <tr><td class="tt">证件名称</td><td id="chu_ming" class="tv"></td><td class="tt">证件编号</td><td id="chu_bian" class="tv"></td></tr>
                <tr><td class="tt">联系电话</td><td id="chu_tel" class="tv"></td><td class="tt">住址/住所</td><td id="chu_addr" class="tv"></td></tr>
                </tbody>
            </table>
        </div>
        <div class="table-box tablenes">
            <div class="title">借款人信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">借款人</td><td class="tv" id="jieer" colspan="3"></td></tr>
                <tr><td class="tt">证件名称</td><td id="jie_ming" class="tv"></td><td class="tt">证件编号</td><td id="jie_bian" class="tv"></td></tr>
                <tr><td class="tt">联系电话</td><td id="jie_tel" class="tv"></td><td class="tt">住址/住所</td><td id="jie_addr" class="tv"></td></tr>
                </tbody>
            </table>
        </div>
        <div class="table-box tablenes">
            <div class="title">担保人信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">担保人1</td><td class="tv" id="daner" colspan="3"></td></tr>
                <tr><td class="tt">证件名称</td><td id="dan_ming" class="tv"></td><td class="tt">证件编号</td><td id="dan_bian" class="tv"></td></tr>
                <tr><td class="tt">联系电话</td><td id="dan_tel" class="tv"></td><td class="tt">住址/住所</td><td id="dan_addr" class="tv"></td></tr>
                <tr><td class="tt">担保人2</td><td class="tv" id="twoer" colspan="3"></td></tr>
                <tr><td class="tt">证件名称</td><td id="two_ming" class="tv"></td><td class="tt">证件编号</td><td id="two_bian" class="tv"></td></tr>
                <tr><td class="tt">联系电话</td><td id="two_tel" class="tv"></td><td class="tt">住址/住所</td><td id="two_addr" class="tv"></td></tr>
                </tbody>
            </table>
        </div>


        <div class="table-box tablenes">
            <div class="title">
                <span>借款信息</span>
                <span class="lijigui colorhong float-r" style="margin-right: 15px">利息计算规则</span>
            </div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">合同编号</td><td id="number" class="tv"></td><td class="tt">借款金额(元)</td><td id="money" class="tv"></td></tr>
                <tr><td class="tt">签章状态</td><td id="state_name" class="tv"></td><td class="tt">签章类型</td><td id="qiantype" class="tv"></td></tr>
                <tr><td class="tt">签订日期</td><td id="qiandt" class="tv"></td><td class="tt">合同份数</td><td id="henum" class="tv"></td></tr>
                <tr><td class="tt">借款用途</td><td class="tv" id="yong" colspan="3"></td></tr>
                <tr><td class="tt">周期利率(%)</td><td id="yuerate" class="tv" colspan="3"></td></tr>

                <tr><td class="tt">借款起始日期</td><td id="startdt" class="tv"></td><td class="tt">借款终止日期</td><td id="enddt" class="tv"></td></tr>
                <tr><td class="tt">出款方式</td><td class="tv" id="fangtype_name" colspan="3"></td></tr>
                <tr><td class="tt">还款方式说明</td><td class="tv" id="huanshuo" colspan="3"></td></tr>



                <tr><td class="tt">备注</td><td class="tv" id="explain" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>


        <div class="table-box tablenes">
            <div class="title">出借人账户信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">账户名称</td><td id="chu_hu" class="tv" colspan="3"></td></tr>
                <tr><td class="tt">开户行</td><td id="chu_kai" class="tv" colspan="3"></td></tr>
                <tr><td class="tt">账号</td><td id="chu_hao" class="tv" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo_tiao">借款收条信息</script>
            <div class="tableShow">
                <table id="datalist_tiao" lay-filter="datalist_tiao"></table>
            </div>
        </div>

        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>

        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo">收款人信息</script>
            <div class="tableShow">
                <table id="datalist" lay-filter="datalist"></table>
            </div>
        </div>

        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo_qianhui">契约锁相关信息</script>
            <div class="tableShow">
                <table id="datalist_qianhui" lay-filter="datalist_qianhui"></table>
            </div>
        </div>



        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_hou_jie_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;

                $("#chuer").text(data.chuer);
                $("#chu_ming").text(data.chu_ming);
                $("#chu_bian").text(data.chu_bian);
                $("#chu_tel").text(data.chu_tel);
                $("#chu_addr").text(data.chu_addr);

                $("#jieer").text(data.jieer);
                $("#jie_ming").text(data.jie_ming);
                $("#jie_bian").text(data.jie_bian);
                $("#jie_tel").text(data.jie_tel);
                $("#jie_addr").text(data.jie_addr);

                $("#daner").text(data.daner);
                $("#dan_ming").text(data.dan_ming);
                $("#dan_bian").text(data.dan_bian);
                $("#dan_tel").text(data.dan_tel);
                $("#dan_addr").text(data.dan_addr);

                $("#twoer").text(data.twoer);
                $("#two_ming").text(data.two_ming);
                $("#two_bian").text(data.two_bian);
                $("#two_tel").text(data.two_tel);
                $("#two_addr").text(data.two_addr);


                $("#money").text(parseFormatNum(data.money));
                $("#yong").text(data.yong);
                $("#yuerate").text(data.yuerate);
                $("#number").text(data.number);
                $("#state_name").html(data.state_name);
                $("#qiantype").html(data.qiantype);
                $("#qiandt").text(data.qiandt);
                $("#henum").text(data.henum);
                $("#startdt").text(data.startdt);
                $("#enddt").text(data.enddt);
                $("#fangtype_name").text(data.fangtype_name);
                $("#huanshuo").text(data.huanshuo);
                $("#chu_hu").text(data.chu_hu);
                $("#chu_hao").text(data.chu_hao);
                $("#chu_kai").text(data.chu_kai);
                $("#explain").text(data.explain);



                var mytableList22 = table.render({
                    elem: "#datalist",data:res.data.list, toolbar: '#toolbarDemo', page: false
                    ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                    ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                    ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                    , cols: [[
                        {type:'numbers',title:'序号'}
                        ,{field: 'fuer', title: '收款人名称'}
                        ,{field: 'bankzhang', title: '账户名称'}
                        ,{field: 'banknum', title: '账号'}
                        ,{field: 'bankname', title: '开户行'}
                        ,{field:'money',title:'付款金额(元)',templet: function(d){
                                return parseFormatNum(d.money);
                            }}
                        ,{field: 'explain', title: '款项说明'}
                        ,{field:'',title:'支付状态',templet: function(d){
                                if(d.kuaninfo){return d.kuaninfo.paystate_name;}
                                return '';
                            }}
                        ,{field:'',title:'已支付金额(元)',templet: function(d){
                                if(d.kuaninfo){
                                    return '<span class="colorlan" onclick="openNavPage(\'查看交易明细信息\',\'account_list/index.php?kuanid='+d.kuaninfo.id+'\')">'+parseFormatNum(d.kuaninfo.payfee)+'</span>';
                                }
                                return '';
                            }}
                        ,{field:'',title:'未支付金额(元)',templet: function(d){
                                if(d.kuaninfo){return parseFormatNum(d.kuaninfo.paynofee)}
                                return '';
                            }}
                    ]]
                    , done: function (res) {
                        soulTable.render(this);
                    }
                });


                var mytableqianhui = table.render({
                    elem: "#datalist_qianhui",data:res.data.qianhui, toolbar: '#toolbarDemo_qianhui', page: false
                    ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                    ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                    ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                    , cols: [[
                        {type:'numbers',title:'序号'}
                        ,{field: 'callbackname', title: '操作类型'}
                        ,{field: 'tenantName', title: '签署方名称'}
                        ,{field: 'contact', title: '联系电话'}
                        ,{field: 'created_at', title: '时间'}
                    ]]
                    , done: function (res) {
                        soulTable.render(this);
                    }
                });

                var mytabletiao = table.render({
                    elem: "#datalist_tiao",data:res.data.tiao, toolbar: '#toolbarDemo_tiao', page: false
                    ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                    ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                    ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                    , cols: [[
                        {type:'numbers',title:'序号'}
                        ,{field:'money',title:'本次放款金额(元)',totalRow: true,templet: function(d){return parseFormatNum(d.money);}}
                        ,{field: 'daodt', title: '放款到账日期'}
                        ,{field: 'shuo', title: '放款说明'}
                    ]]
                    , done: function (res) {
                        soulTable.render(this);
                    }
                });




                public_flow_show_display(res.data.billinfo);
                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('hou_jie', param_id);
    });


    $(".lijigui").hover(function(){
        var tipsStr = '利息计算规则：'+'<br>';
        tipsStr += '1. 借款利率： 2 % / 一个周期（一个周期为30天）。'+'<br>';
        tipsStr += '2.计息方式'+'<br>';
        tipsStr += '2.1 利息计算公式：利息=借款本金*借款利率*（周期数+余天数/30）；'+'<br>';
        tipsStr += '2.2 计息规则：'+'<br>';
        tipsStr += '2.1.1 总借款天数自甲方实际支付借款之日起计算，至乙方偿还借款本金之日止；'+'<br>';
        tipsStr += '2.1.2 周期数=总借款天数/30的整数部分；'+'<br>';
        tipsStr += '2.1.3 余天数=总借款天数-周期数*30；'+'<br>';
        tipsStr += '①余天数不足10日的：余天数=实际天数；'+'<br>';
        tipsStr += '②余天数超过10日的：余天数=30；'+'<br>';
        tipsStr += '备注：'+'<br>';
        tipsStr += '本条“不足10日”不包含10日，“超过10日”包含10日。'+'<br>';
        tipsStr += '2.3 借款期限届满乙方须继续使用借款本金的，甲方以未还本金为基数，按本合同第四条'+'<br>';
        tipsStr += '约定的计息方式重新计息。'+'<br>';
        hhzhu_index = layer.tips(tipsStr,this,{time:0,area: ['500px', 'auto']});
    },function(){layer.close(hhzhu_index);});

</script>
</body>
</html>




